import { responseData } from "@/api/user/type"

// 默认返沪数据
export interface ResponseData {
    code: number,
    message: string,
    ok: boolean
}
// SPU类型
export interface SpuData {
    id?: number | string,
    spuName: string,
    description: string,
    category3Id: string | number,
    tmId: string | number,
    spuSaleAttrList: any,
    spuImageList: any
}
// 包含SPU类型的数组
export type Records = SpuData[]
// 定义获取SPU接口数据的ts类型
export interface HasSpuResponseData extends ResponseData {
    data: {
        records: Records,
        total: number,
        size: number,
        current: number,
        searchCount: boolean,
        pages: number
    }
}
// 所有品牌数据的ts类型
export interface TradeMarkData {
    id: number,
    tmName: string,
    logoUrl: string
}
// 品牌接口返回的数据ts类型
export interface AllTradeMark extends ResponseData {
    data: TradeMarkData[]
}
// 商品图片的ts类型
export interface SpuImg {
    id: number,
    spuId: number,
    imgName: string,
    imgUrl: string,
}
// 已有SPU的照片墙数据类型
export interface SpuHasImg extends ResponseData {
    data: SpuImg[]
}
// 销售属性值的ts类型
export interface SaleAttrValue {
    id?: number,
    spuId?: number,
    baseSaleAttrId: number | string,
    saleAttrValueName: string,
    saleAttrName: string,
    isChecked?: any
}
// 销售属性的ts类型
export type spuSaleAttrValueList = SaleAttrValue[]
// 销售属性对象ts类型
export interface SaleAttr {
    id?: number,
    spuId?: number,
    baseSaleAttrId: number | string,
    saleAttrName: string,
    spuSaleAttrValueList: spuSaleAttrValueList,
    flag?: boolean,
    saleAttrValue?: string
}
// SPU已有的销售属性接口返回数据ts类型
export interface SaleAttrResponseData extends ResponseData {
    data: SaleAttr[]
}
// 已有的全部SPU返回ts类型
export interface HasSaleAttr {
    id: number,
    name: string
}
export interface HasSaleAttrResponseData extends responseData {
    data: HasSaleAttr[]
}
export interface SkuData {
    category3Id: string | number,
    spuId: string | number,
    tmId: string | number,
    skuName: string,
    price: number | string,
    weight: number | string,
    skuDesc: string,
    skuAttrValueList: skuAttr,
    skuSaleAttrValueList: skuSaleAttr,
    skuDefaultImg: string
}
// 平台属性值
export interface skuAttrValue {
    attrId: string | number,
    valueId: string | number
}
// 平台属性
export type skuAttr = skuAttrValue[]
// 销售属性值
export interface skuSaleAttrValue {
    saleAttrId: number | string,
    saleAttrValueId: number | string
}
// 销售属性
export type skuSaleAttr = skuSaleAttrValue[]

// sku数据
export interface SkuInfoData extends responseData {
    data: SkuData[]
}